package com.pjchat.pjchatclient.handlerfactory;

import com.ita.im.model.UnitType;
import com.pjchat.pjchatclient.handler.BasicHandler;
import com.pjchat.pjchatclient.handlerImpl.HandlerForList;
import com.pjchat.pjchatclient.handlerImpl.HandlerForLogin;
import com.pjchat.pjchatclient.handlerImpl.HandlerForLogout;
import com.pjchat.pjchatclient.handlerImpl.HandlerForMessage;
import com.pjchat.pjchatclient.handlerImpl.HandlerForRegister;

public class HandlerFactory {
	public static BasicHandler produce(UnitType type) {
		switch (type) {
		case USER_REGISTER:
			return HandlerForRegister.getInstance();
		case USER_LOGIN:
			return HandlerForLogin.getInstance();
		case USER_LOGOUT:
			return HandlerForLogout.getInstance();
		case USER_LIST:
			return HandlerForList.getInstance();
		case MESSAGE:
			return HandlerForMessage.getInstance();
		default:
			break;
		}
		return null;
	}
}
